#include "creator.h"

#include "ui/mainwindow.h"
#include "ui/scriptcreator.h"
#include <extensions/plugin.h>
#include <extensions/application.h>
#include <extensions/context.h>

Q_EXPORT_PLUGIN2(application_creator, Creator)

class CreatorPrivate{
public:
    CreatorPrivate():main() {}
    ~CreatorPrivate()
    {
        delete main;
    }

    ScriptCreator* main;
};

Creator::Creator() :
    O_PRIVATE_CREATE(Creator)
{
    O_D(Creator);
}

void Creator::Setup(Type type, const Optra::Extensions::ContextPtr &ctx)
{
    O_D(Creator);
    QMap<QString, QSize> customSizeHints;
    d->main = new ScriptCreator(context());// MainWindow(context(), customSizeHints, 0, Qt::Dialog);
    setMainWindow(d->main);
}

Creator::~Creator()
{
    O_PRIVATE_DELETE;
}
